<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ include file="/WEB-INF/views/include/head.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>部门管理</title>
    <script type="text/javascript">
        var tableHeight = 0;
        var table;
        $(function () {
            tableHeight = document.documentElement.clientHeight - 145 + "px";//table高度适应不同屏幕分辨率
            tableInit();//表格初始化
            //DataTables插件 具体参数意义可查看DataTables中文网
            function tableInit() {
                table = $('#dept').DataTable({
                    "dom": 'rt<"bottom"iflp><"clear">',
                    "pagingType": "full_numbers",
                    "lengthChange": true,
                    "lengthMenu": [10, 20, 50, 100],
                    "searching": false,
                    "scrollY": tableHeight,
                    "scrollCollapse": "true",
                    "language": {
                        "url": "${ctxStatic}/common/language.json",
                    },
                });
            }

            $.fn.dataTable.ext.errMode = function (s, h, m) {
            };
        })
    </script>
</head>
<body style="background:#f0f9fd;">
<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">首页</a></li>
        <li><a href="#">数据表</a></li>
        <li><a href="#">基本内容</a></li>
    </ul>
</div>

<div id="rightinfo" class="rightinfo">
    <div class="tools">
        <ul class="toolbar">
            <li id="add"><span><img src="${ctxStatic}/common/images/t01.png"/></span>添加</li>
        </ul>

        <ul class="toolbar1">
            <li style="padding-right: 0px;"><input style="width: 320px; margin-left: 0px;" id="searchinput"
                                                   name="searchinput" type="text" class="searchinput"
                                                   placeholder="请输入区域名称进行查询"/></li>
            <li id="search"><span><img src="${ctxStatic}/common/images/t05.png"/></span>搜索</li>
        </ul>
    </div>
    <table id="dept" class="tablelist">
        <thead>
        <tr>
            <th>部门编号<i class="sort"><img src="${ctxStatic}/common/images/px.gif"/></i></th>
            <th>部门名称</th>
            <th>上级部门</th>
            <th>部门描述</th>
            <shiro:hasPermission name="basic:department:edit">
            <th>操作</th>
            </shiro:hasPermission>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${list}" var="department">
            <c:if test="${department.showSign eq '1'}">
                <tr>
                    <td>${department.code}</td>
                    <td>${department.name}</td>
                    <td>${department.parent.name}</td>
                    <td>${department.description}</td>
                    <shiro:hasPermission name="basic:department:edit">
                    <td><a href="#" class="tablelink">修改</a> <a href="#" class="tablelink"> 删除</a></td>
                    </shiro:hasPermission>
                </tr>
            </c:if>
        </c:forEach>
        </tbody>
    </table>
</div>
<div id="dialog">
    <iframe id="iframe_dialog" name="iframe_dialog"
            style="position:absolute; scrolling:no;overflow: hidden; height: 100%;width:100%" class="dialog-iframe"
            src=""></iframe>
</div>

</body>
</html>